-
Notifications
You must be signed in to change notification settings - Fork 87
reflect change in rotate!
from LinearAlgebra.jl
#603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/src/host/linalg.jl b/src/host/linalg.jl
index 4933839..a21d694 100644
--- a/src/host/linalg.jl
+++ b/src/host/linalg.jl
@@ -687,8 +687,8 @@ function LinearAlgebra.rotate!(x::AbstractGPUArray, y::AbstractGPUArray, c::Numb
i = @index(Global, Linear)
@inbounds xi = x[i]
@inbounds yi = y[i]
- @inbounds x[i] = s*yi + c *xi
- @inbounds y[i] = c*yi - conj(s)*xi
+ @inbounds x[i] = s * yi + c * xi
+ @inbounds y[i] = c * yi - conj(s) * xi
end
rotate_kernel!(get_backend(x))(x, y, c, s; ndrange = size(x))
return x, y
diff --git a/test/testsuite.jl b/test/testsuite.jl
index e7c8d9d..171eeed 100644
--- a/test/testsuite.jl
+++ b/test/testsuite.jl
@@ -63,7 +63,7 @@ function out_has_NaNs(f, AT::Type{<:AbstractGPUArray}, xs...)
arg_out = f(arg_in...)
return has_NaNs(arg_out)
end
-
+
# element types that are supported by the array type
supported_eltypes(AT, test) = supported_eltypes(AT)
supported_eltypes(AT) = supported_eltypes()
diff --git a/test/testsuite/linalg.jl b/test/testsuite/linalg.jl
index f01e2f4..986e979 100644
--- a/test/testsuite/linalg.jl
+++ b/test/testsuite/linalg.jl
@@ -348,7 +348,7 @@ end
@test compare(mul!, AT, y, f(A), x, Ref(T(4)), Ref(T(5)))
if isfloattype(T)
y_NaN, A_NaN, x_NaN = fill(NaN_T(T), 4), fill(NaN_T(T), 4, 4), fill(NaN_T(T), 4)
- if !(T==Float16) && !(T == ComplexF16) # skip Float16/ComplexF16 until https://github.com/JuliaLang/LinearAlgebra.jl/issues/1399 is fixed and only check correct strong zero behaviour of AbstractGPUArray
+ if !(T == Float16) && !(T == ComplexF16) # skip Float16/ComplexF16 until https://github.com/JuliaLang/LinearAlgebra.jl/issues/1399 is fixed and only check correct strong zero behaviour of AbstractGPUArray
@test compare(mul!, AT, y_NaN, f(A_NaN), x_NaN, Ref(false), Ref(false))
end
@test !out_has_NaNs(mul!, AT, y_NaN, f(A_NaN), x_NaN, Ref(false), Ref(false)) |
Thanks! Mind adding those examples as a test? |
Not sure if this is the right approach. Should we also compare "strong zero"/NaN behaviour against LinearAlgebra.jl or should this be guaranteed only by GPUArrays.jl ? In other words: should the tests use For consistency I added similar tests for Essentially this now tests whether the multiplication with |
Ideally we test compatibility against Array/stdlibs, but if that behavior is clearly buggy it's fine to include |
This should do it. Currently skipped |
This reflects a change in LinearAlgebra.jl (JuliaLang/LinearAlgebra.jl#1323). The previous implementation of
rotate!
did not respectfalse
as a strong zero. For consistency, the implementation in GPUArrays.jl should also be adapted.Essentially, this covers the edge case:
NaN
/false
behaviour be tested against?